import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

class GraphicPage extends StatelessWidget {
  /// Constructs a [HomeScreen]
  const GraphicPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Home Screen')),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () => context.push('/graphic/interval'),
            child: const Text('interval'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/lineAreaPoint'),
            child: const Text('lineAreaPoint'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/echarts'),
            child: const Text('echarts'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/polygon'),
            child: const Text('polygon'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/interaction'),
            child: const Text('interaction'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/animation'),
            child: const Text('animation'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/bigData'),
            child: const Text('bigData'),
          ),
          ElevatedButton(
            onPressed: () => context.push('/graphic/crossHair'),
            child: const Text('crossHair'),
          ),
        ],
      ),
    );
  }
}

/// The details screen
class DetailsScreen extends StatelessWidget {
  /// Constructs a [DetailsScreen]
  const DetailsScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Details Screen')),
      body: Column(
        children: [
          ElevatedButton(
            onPressed: () => context.push('/'),
            child: Column(
              children: [
                const Text('Go back to the Home screen'),
                TextField()
              ],
            ),
          ),
        ],
      ),
    );
  }
}